/*
 * @Author: WuFeng <763467339@qq.com>
 * @Date: 2022-03-22 12:12:49
 * @LastEditTime: 2022-07-26 16:00:56
 * @LastEditors: WuFeng <763467339@qq.com>
 * @Description: 项目入口文件
 * @FilePath: \vue3-element-plus-web\src\main.js
 * @Copyright 版权声明
 */

import { createApp } from 'vue'

// vue-simple-uploader
import uploader from 'vue-simple-uploader'
import 'vue-simple-uploader/dist/style.css'

// ElementPlus
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
import locale from 'element-plus/lib/locale/lang/zh-cn'

// avue 、 avue-form-design
import Avue from '@smallwei/avue'
import '@smallwei/avue/lib/index.css'
import AvueFormDesign from '@sscfaith/avue-form-design'

// global css
import '@/styles/index.scss'

import App from './App.vue'

// 路由
import router from './router'

// Vuex
import store from './store'

// 自定义 icon
import SvgIcon from '@/icons'

// GlobalDrawer
import GlobalDrawer from '@/components/GlobalDrawer'

// DrawerLayout
import DrawerLayout from '@/components/DrawerLayout'

// permission control
import '@/permission'

const app = createApp(App)

import directive from '@/directive/index'

// 多语言
import language, { getLanguage, $t } from './language'
language(app)

// createApp(App).
app.use(directive)
  .use([getLanguage, $t])
  .use(store)
  .use(router)
  .use(ElementPlus, { locale })
  .use(Avue)
  .use(AvueFormDesign)
  .use(uploader)
  .component('svg-icon', SvgIcon)
  .component('global-drawer', GlobalDrawer)
  .component('drawer-layout', DrawerLayout)
  .mount('#app')
